 //The following include files are necessary to allow your MyPanel.cpp to compile.
 #include "cbase.h"
 #include "iVGUI_gplay_adv.h"

 using namespace vgui;
 #include <vgui/IVGui.h>
#include <vgui_controls/CheckButton.h>
 #include <vgui_controls/Frame.h>
 
 //CMyPanel class: Tutorial example class
 class CVGUI_gplay_adv : public vgui::Frame
 {
 	DECLARE_CLASS_SIMPLE(CVGUI_gplay_adv, vgui::Frame); 
 	//CMyPanel : This Class / vgui::Frame : BaseClass
 
 	CVGUI_gplay_adv(vgui::VPANEL parent); 	// Constructor
 	~CVGUI_gplay_adv(){};				// Destructor
 
 protected:
 	//VGUI overrides:
 	virtual void OnTick();
 	virtual void OnCommand(const char* pcCommand);
 
 private:
 	//Other used VGUI control Elements:
	vgui::CheckButton* cb_QuickInfo;
 };

 // Constuctor: Initializes the Panel
CVGUI_gplay_adv::CVGUI_gplay_adv(vgui::VPANEL parent)
: BaseClass(NULL, "gplay_adv")
{
	SetParent( parent );
 
	SetKeyBoardInputEnabled( true );
	SetMouseInputEnabled( true );
 
	SetProportional( true );
	SetTitleBarVisible( true );
	SetMinimizeButtonVisible( false );
	SetMaximizeButtonVisible( false );
	SetCloseButtonVisible( false );
	SetSizeable( false );
	SetMoveable( false );
	SetVisible( true );
 
 
	SetScheme(vgui::scheme()->LoadSchemeFromFile("resource/SourceScheme.res", "SourceScheme"));
	LoadControlSettings("resource/UI/gplay_adv.res");
	vgui::ivgui()->AddTickSignal( GetVPanel(), 100 );
 
	//cb_QuickInfo = new vgui::CheckButton(this, "cb_QuickInfo", "Quickinfo (ammo & health on crosshair)");


	DevMsg("Adv_Gameplay has been constructed\n");

}

void CVGUI_gplay_adv::OnTick()
{
	BaseClass::OnTick();
	SetVisible(cl_showadvgp.GetBool()); //CL_SHOWMYPANEL / 1 BY DEFAULT

}

CON_COMMAND(ToggleAdvGP, "")
{
	cl_showadvgp.SetValue(!cl_showadvgp.GetBool());
};

//Class: CMyPanelInterface Class. Used for construction.
class CMyPanelInterface : public iVGUI_gplay_adv
{
private:
	CVGUI_gplay_adv *MyPanel;
public:
	CMyPanelInterface()
	{
		MyPanel = NULL;
	}
	void Create(vgui::VPANEL parent)
	{
		MyPanel = new CVGUI_gplay_adv(parent);
	}
	void Destroy()
	{
		if (MyPanel)
		{
			MyPanel->SetParent( (vgui::Panel *)NULL);
			delete MyPanel;
		}
	}

};
static CMyPanelInterface g_MyPanel;
iVGUI_gplay_adv* mypanel = (iVGUI_gplay_adv*)&g_MyPanel;

ConVar cl_showadvgp("cl_showadvgp", "1", FCVAR_CLIENTDLL, "");
